home *** CD-ROM | disk | FTP | other *** search
/ Apple WWDC 1996 / WWDC96_1996 (CD).toast / Technology Materials / MacOS 8 Resources / Developer Tools / Mac OS 8 Interfaces & Libraries / Interfaces / AIncludes / DBDMA.a < prev    next >
Encoding:
Text File  |  1996-05-01  |  13.6 KB  |  458 lines  |  [TEXT/MPS ]

  1. ;
  2. ;    File:        DBDMA.a
  3. ;
  4. ;    Contains:    Descriptor Based DMA Interfaces
  5. ;
  6. ;    Version:    Technology:    System 7.5
  7. ;                Release:    Universal Interfaces 3.0d3 on Copland DR1
  8. ;
  9. ;    Copyright:    © 1984-1996 by Apple Computer, Inc.  All rights reserved.
  10. ;
  11. ;    Bugs?:        If you find a problem with this file, send the file and version
  12. ;                information (from above) and the problem description to:
  13. ;
  14. ;                    Internet:    apple.bugs@applelink.apple.com
  15. ;                    AppleLink:    APPLE.BUGS
  16. ;
  17. ;
  18.     IF &TYPE('__DBDMA__') = 'UNDEFINED' THEN
  19. __DBDMA__ SET 1
  20.  
  21.     IF &TYPE('__CONDITIONALMACROS__') = 'UNDEFINED' THEN
  22.     include 'ConditionalMacros.a'
  23.     ENDIF
  24.     IF &TYPE('__PCI__') = 'UNDEFINED' THEN
  25.     include 'PCI.a'
  26.     ENDIF
  27.     IF FOR_SYSTEM8_PREEMPTIVE THEN
  28.     IF &TYPE('__CODEFRAGMENTS__') = 'UNDEFINED' THEN
  29.     include 'CodeFragments.a'
  30.     ENDIF
  31.     IF &TYPE('__DRIVERSERVICES__') = 'UNDEFINED' THEN
  32.     include 'DriverServices.a'
  33.     ENDIF
  34.     ENDIF
  35.     IF FOR_SYSTEM7_AND_SYSTEM8_PREEMPTIVE THEN
  36. ; These macros are are DBDMAChannelRegisters accessor functions.
  37.  
  38. ;    ……………………………………………………………………………………………………………………………………………………………………………………………………………………
  39. ;    Macro:    _SetChannelControl &a, &d
  40. ;
  41. ;    In:        &a        Address register containing a pointer to a DB-DMA channel register set
  42. ;            &d.L    Data register containing a value to write to the ChannelControl register
  43. ;
  44. ;    Notes:    &d is not guaranteed to be preserved.
  45. ;            The macro generates code for either big-endian or little-endian storage.
  46. ;    ……………………………………………………………………………………………………………………………………………………………………………………………………………………
  47.  
  48.                 macro
  49.                 _SetChannelControl &a, &d
  50.  
  51.                 with    DBDMAChannelRegisters
  52.  
  53.                 _EndianSwap32Bit    &d
  54.                 eieio
  55.                 move.l    &d, channelControl(&a)
  56.                 eieio
  57.  
  58.                 endwith
  59.                 endm
  60.  
  61. ;    ……………………………………………………………………………………………………………………………………………………………………………………………………………………
  62. ;    Macro:    _GetChannelStatus &a, &d
  63. ;
  64. ;    In:        &a        Address register containing a pointer to a DB-DMA channel register set
  65. ;    Out:    &d.L    Data register containing the ChannelStatus return value
  66. ;
  67. ;    Notes:    The macro generates code for either big-endian or little-endian storage.
  68. ;    ……………………………………………………………………………………………………………………………………………………………………………………………………………………
  69.  
  70.                 macro
  71.                 _GetChannelStatus &a, &d
  72.  
  73.                 with    DBDMAChannelRegisters
  74.  
  75.                 move.l    channelStatus(&a), &d
  76.                 _EndianSwap32Bit    &d
  77.  
  78.                 endwith
  79.                 endm
  80.  
  81. ;    ……………………………………………………………………………………………………………………………………………………………………………………………………………………
  82. ;    Macro:    _GetCommandPtr &a, &d
  83. ;
  84. ;    In:        &a        Address register containing a pointer to a DB-DMA channel register set
  85. ;    Out:    &d.L    Data register containing the CommandPtrLo return value
  86. ;
  87. ;    Notes:    The macro generates code for either big-endian or little-endian storage.
  88. ;    ……………………………………………………………………………………………………………………………………………………………………………………………………………………
  89.  
  90.                 macro
  91.                 _GetCommandPtr &a, &d
  92.  
  93.                 with    DBDMAChannelRegisters
  94.  
  95.                 move.l    commandPtrLo(&a), &d
  96.                 _EndianSwap32Bit    &d
  97.  
  98.                 endwith
  99.                 endm
  100.  
  101. ;    ……………………………………………………………………………………………………………………………………………………………………………………………………………………
  102. ;    Macro:    _SetCommandPtr &a, &d
  103. ;
  104. ;    In:        &a        Address register containing a pointer to a DB-DMA channel register set
  105. ;            &d.L    Data register containing a value to write to the CommandPtrLo register
  106. ;
  107. ;    Notes:    &d is not guaranteed to be preserved.
  108. ;            The macro generates code for either big-endian or little-endian storage.
  109. ;    ……………………………………………………………………………………………………………………………………………………………………………………………………………………
  110.  
  111.                 macro
  112.                 _SetCommandPtr &a, &d
  113.  
  114.                 with    DBDMAChannelRegisters
  115.  
  116.                 _EndianSwap32Bit    &d
  117.                 move.l    &d, commandPtrLo(&a)
  118.                 eieio
  119.  
  120.                 endwith
  121.                 endm
  122.  
  123. ;    ……………………………………………………………………………………………………………………………………………………………………………………………………………………
  124. ;    Macro:    _GetInterruptSelect &a, &d
  125. ;
  126. ;    In:        &a        Address register containing a pointer to a DB-DMA channel register set
  127. ;    Out:    &d.L    Data register containing the InterruptSelect return value
  128. ;
  129. ;    Notes:    The macro generates code for either big-endian or little-endian storage.
  130. ;    ……………………………………………………………………………………………………………………………………………………………………………………………………………………
  131.  
  132.                 macro
  133.                 _GetInterruptSelect &a, &d
  134.  
  135.                 with    DBDMAChannelRegisters
  136.  
  137.                 move.l    interruptSelect(&a), &d
  138.                 _EndianSwap32Bit    &d
  139.  
  140.                 endwith
  141.                 endm
  142.  
  143. ;    ……………………………………………………………………………………………………………………………………………………………………………………………………………………
  144. ;    Macro:    _SetInterruptSelect &a, &d
  145. ;
  146. ;    In:        &a        Address register containing a pointer to a DB-DMA channel register set
  147. ;            &d.L    Data register containing a value to write to the InterruptSelect register
  148. ;
  149. ;    Notes:    &d is not guaranteed to be preserved.
  150. ;            The macro generates code for either big-endian or little-endian storage.
  151. ;    ……………………………………………………………………………………………………………………………………………………………………………………………………………………
  152.  
  153.                 macro
  154.                 _SetInterruptSelect &a, &d
  155.  
  156.                 with    DBDMAChannelRegisters
  157.  
  158.                 _EndianSwap32Bit    &d
  159.                 move.l    &d, interruptSelect(&a)
  160.                 eieio
  161.  
  162.                 endwith
  163.                 endm
  164.  
  165. ;    ……………………………………………………………………………………………………………………………………………………………………………………………………………………
  166. ;    Macro:    _GetBranchSelect &a, &d
  167. ;
  168. ;    In:        &a        Address register containing a pointer to a DB-DMA channel register set
  169. ;    Out:    &d.L    Data register containing the BranchSelect return value
  170. ;
  171. ;    Notes:    The macro generates code for either big-endian or little-endian storage.
  172. ;    ……………………………………………………………………………………………………………………………………………………………………………………………………………………
  173.  
  174.                 macro
  175.                 _GetBranchSelect &a, &d
  176.  
  177.                 with    DBDMAChannelRegisters
  178.  
  179.                 move.l    branchSelect(&a), &d
  180.                 _EndianSwap32Bit    &d
  181.  
  182.                 endwith
  183.                 endm
  184.  
  185. ;    ……………………………………………………………………………………………………………………………………………………………………………………………………………………
  186. ;    Macro:    _SetBranchSelect &a, &d
  187. ;
  188. ;    In:        &a        Address register containing a pointer to a DB-DMA channel register set
  189. ;            &d.L    Data register containing a value to write to the BranchSelect register
  190. ;
  191. ;    Notes:    &d is not guaranteed to be preserved.
  192. ;            The macro generates code for either big-endian or little-endian storage.
  193. ;    ……………………………………………………………………………………………………………………………………………………………………………………………………………………
  194.  
  195.                 macro
  196.                 _SetBranchSelect &a, &d
  197.  
  198.                 with    DBDMAChannelRegisters
  199.  
  200.                 _EndianSwap32Bit    &d
  201.                 move.l    &d, branchSelect(&a)
  202.                 eieio
  203.  
  204.                 endwith
  205.                 endm
  206.  
  207. ;    ……………………………………………………………………………………………………………………………………………………………………………………………………………………
  208. ;    Macro:    _GetWaitSelect &a, &d
  209. ;
  210. ;    In:        &a        Address register containing a pointer to a DB-DMA channel register set
  211. ;    Out:    &d.L    Data register containing the WaitSelect return value
  212. ;
  213. ;    Notes:    The macro generates code for either big-endian or little-endian storage.
  214. ;    ……………………………………………………………………………………………………………………………………………………………………………………………………………………
  215.  
  216.                 macro
  217.                 _GetWaitSelect &a, &d
  218.  
  219.                 with    DBDMAChannelRegisters
  220.  
  221.                 move.l    waitSelect(&a), &d
  222.                 _EndianSwap32Bit    &d
  223.  
  224.                 endwith
  225.                 endm
  226.  
  227. ;    ……………………………………………………………………………………………………………………………………………………………………………………………………………………
  228. ;    Macro:    _SetWaitSelect &a, &d
  229. ;
  230. ;    In:        &a        Address register containing a pointer to a DB-DMA channel register set
  231. ;            &d.L    Data register containing a value to write to the WaitSelect register
  232. ;
  233. ;    Notes:    &d is not guaranteed to be preserved.
  234. ;            The macro generates code for either big-endian or little-endian storage.
  235. ;    ……………………………………………………………………………………………………………………………………………………………………………………………………………………
  236.  
  237.                 macro
  238.                 _SetWaitSelect &a, &d
  239.  
  240.                 with    DBDMAChannelRegisters
  241.  
  242.                 _EndianSwap32Bit    &d
  243.                 move.l    &d, waitSelect(&a)
  244.                 eieio
  245.  
  246.                 endwith
  247.                 endm
  248.  
  249.  
  250. ; These macros are DBDMADescriptor accessor functions.
  251.  
  252. ;    ……………………………………………………………………………………………………………………………………………………………………………………………………………………
  253. ;    Macro:    _MakeCCDescriptor &a, &op, &addr
  254. ;
  255. ;    In:        &a        Address register containing a pointer to a DBDMADescriptor
  256. ;            &op.L    Data register containing a catenated command and reqCount
  257. ;            &addr.L    Data register containing a physical DMA address
  258. ;
  259. ;    Notes:    &op/&addr are not guaranteed to be preserved.
  260. ;            The macro generates code for either big-endian or little-endian storage.
  261. ;            The command field must be written to memory last for STOP replacement.
  262. ;    ……………………………………………………………………………………………………………………………………………………………………………………………………………………
  263.  
  264.                 macro
  265.                 _MakeCCDescriptor &a, &op, &addr
  266.  
  267.                 with    DBDMADescriptor
  268.                 
  269.                 _EndianSwap32Bit    &addr
  270.                 move.l    &addr,address(&a)        ; address
  271.                 clr.l    cmdDep(&a)                ; cmdDep is frequently reserved
  272.                 clr.l    result(&a)                ; initialize status and residual count
  273.                 sync
  274.  
  275.                 _EndianSwap32Bit    &op
  276.                 move.l    &op,operation(&a)        ; command and count
  277.                 sync
  278.  
  279.                 endwith
  280.                 endm
  281.  
  282. ;    ……………………………………………………………………………………………………………………………………………………………………………………………………………………
  283. ;    Macro:    _MakeCmdDepCCDescriptor &a, &op, &addr, &dep
  284. ;
  285. ;    In:        &a        Address register containing a pointer to a DBDMADescriptor
  286. ;            &op.L    Data register containing a catenated command and reqCount
  287. ;            &addr.L    Data register containing a physical DMA address
  288. ;            &dep.L    Data register containing a physical DMA address
  289. ;
  290. ;    Notes:    &op/&addr/&dep are not guaranteed to be preserved.
  291. ;            The macro generates code for either big-endian or little-endian storage.
  292. ;            The command field must be written to memory last for STOP_CMD replacement.
  293. ;    ……………………………………………………………………………………………………………………………………………………………………………………………………………………
  294.  
  295.                 macro
  296.                 _MakeCmdDepCCDescriptor &a, &op, &addr, &dep
  297.  
  298.                 with    DBDMADescriptor
  299.                 
  300.                 _EndianSwap32Bit    &addr
  301.                 move.l    &addr,address(&a)        ; address
  302.                 _EndianSwap32Bit    &dep
  303.                 move.l    &dep,cmdDep(&a)            ; cmdDep is frequently reserved
  304.                 clr.l    result(&a)                ; initialize status and residual count
  305.                 sync
  306.  
  307.                 _EndianSwap32Bit    &op
  308.                 move.l    &op,operation(&a)        ; command and count
  309.                 sync
  310.  
  311.                 endwith
  312.                 endm
  313.  
  314. ;    ……………………………………………………………………………………………………………………………………………………………………………………………………………………
  315. ;    Macro:    _GetCCOperation &a, &d
  316. ;
  317. ;    In:        &a        Address register containing a pointer to a DBDMADescriptor
  318. ;    Out:    &d.L    Data register containing the canonical operation field read value
  319. ;
  320. ;    Notes:    The macro generates code for either big-endian or little-endian storage.
  321. ;    ……………………………………………………………………………………………………………………………………………………………………………………………………………………
  322.  
  323.                 macro
  324.                 _GetCCOperation &a, &d
  325.  
  326.                 move.l    DBDMADescriptor.operation(&a), &d
  327.                 _EndianSwap32Bit    &d
  328.  
  329.                 endm
  330.  
  331. ;    ……………………………………………………………………………………………………………………………………………………………………………………………………………………
  332. ;    Macro:    _SetCCOperation &a, &d
  333. ;
  334. ;    In:        &a        Address register containing a pointer to a DBDMADescriptor
  335. ;            &d.L    Data register containing the canonical operation field write value
  336. ;
  337. ;    Notes:    &d.L is not guaranteed to be preserved.
  338. ;            The macro generates code for either big-endian or little-endian storage.
  339. ;    ……………………………………………………………………………………………………………………………………………………………………………………………………………………
  340.  
  341.                 macro
  342.                 _SetCCOperation &a, &d
  343.  
  344.                 _EndianSwap32Bit    &d
  345.                 move.l    &d, DBDMADescriptor.operation(&a)
  346.  
  347.                 endm
  348.  
  349. ;    ……………………………………………………………………………………………………………………………………………………………………………………………………………………
  350. ;    Macro:    _GetCCAddress &a, &d
  351. ;
  352. ;    In:        &a        Address register containing a pointer to a DBDMADescriptor
  353. ;    Out:    &d.L    Data register containing the canonical address field read value
  354. ;
  355. ;    Notes:    The macro generates code for either big-endian or little-endian storage.
  356. ;    ……………………………………………………………………………………………………………………………………………………………………………………………………………………
  357.  
  358.                 macro
  359.                 _GetCCAddress &a, &d
  360.  
  361.                 move.l    DBDMADescriptor.address(&a), &d
  362.                 _EndianSwap32Bit    &d
  363.  
  364.                 endm
  365.  
  366. ;    ……………………………………………………………………………………………………………………………………………………………………………………………………………………
  367. ;    Macro:    _SetCCAddress &a, &d
  368. ;
  369. ;    In:        &a        Address register containing a pointer to a DBDMADescriptor
  370. ;            &d.L    Data register containing the canonical address field write value
  371. ;
  372. ;    Notes:    &d.L is not guaranteed to be preserved.
  373. ;            The macro generates code for either big-endian or little-endian storage.
  374. ;    ……………………………………………………………………………………………………………………………………………………………………………………………………………………
  375.  
  376.                 macro
  377.                 _SetCCAddress &a, &d
  378.  
  379.                 _EndianSwap32Bit    &d
  380.                 move.l    &d, DBDMADescriptor.address(&a)
  381.  
  382.                 endm
  383.  
  384. ;    ……………………………………………………………………………………………………………………………………………………………………………………………………………………
  385. ;    Macro:    _GetCCCmdDep &a, &d
  386. ;
  387. ;    In:        &a        Address register containing a pointer to a DBDMADescriptor
  388. ;    Out:    &d.L    Data register containing the canonical cmdDep field read value
  389. ;
  390. ;    Notes:    The macro generates code for either big-endian or little-endian storage.
  391. ;    ……………………………………………………………………………………………………………………………………………………………………………………………………………………
  392.  
  393.                 macro
  394.                 _GetCCCmdDep &a, &d
  395.  
  396.                 move.l    DBDMADescriptor.cmdDep(&a), &d
  397.                 _EndianSwap32Bit    &d
  398.  
  399.                 endm
  400.  
  401. ;    ……………………………………………………………………………………………………………………………………………………………………………………………………………………
  402. ;    Macro:    _SetCCCmdDep &a, &d
  403. ;
  404. ;    In:        &a        Address register containing a pointer to a DBDMADescriptor
  405. ;            &d.L    Data register containing the canonical cmdDep field write value
  406. ;
  407. ;    Notes:    &d.L is not guaranteed to be preserved.
  408. ;            The macro generates code for either big-endian or little-endian storage.
  409. ;    ……………………………………………………………………………………………………………………………………………………………………………………………………………………
  410.  
  411.                 macro
  412.                 _SetCCCmdDep &a, &d
  413.  
  414.                 _EndianSwap32Bit    &d
  415.                 move.l    &d, DBDMADescriptor.cmdDep(&a)
  416.  
  417.                 endm
  418.  
  419. ;    ……………………………………………………………………………………………………………………………………………………………………………………………………………………
  420. ;    Macro:    _GetCCResult &a, &d
  421. ;
  422. ;    In:        &a        Address register containing a pointer to a DBDMADescriptor
  423. ;    Out:    &d.L    Data register containing the canonical result field read value
  424. ;
  425. ;    Notes:    The macro generates code for either big-endian or little-endian storage.
  426. ;    ……………………………………………………………………………………………………………………………………………………………………………………………………………………
  427.  
  428.                 macro
  429.                 _GetCCResult &a, &d
  430.  
  431.                 move.l    DBDMADescriptor.result(&a),&d
  432.                 _EndianSwap32Bit    &d
  433.  
  434.                 endm
  435.  
  436. ;    ……………………………………………………………………………………………………………………………………………………………………………………………………………………
  437. ;    Macro:    _SetCCResult &a, &d
  438. ;
  439. ;    In:        &a        Address register containing a pointer to a DBDMADescriptor
  440. ;            &d.L    Data register containing the canonical result field write value
  441. ;
  442. ;    Notes:    &d.L is not guaranteed to be preserved.
  443. ;            The macro generates code for either big-endian or little-endian storage.
  444. ;    ……………………………………………………………………………………………………………………………………………………………………………………………………………………
  445.  
  446.                 macro
  447.                 _SetCCResult &a, &d
  448.  
  449.                 _EndianSwap32Bit    &d
  450.                 move.l    &d, DBDMADescriptor.result(&a)
  451.  
  452.                 endm
  453.  
  454.  
  455.     ENDIF
  456.     ENDIF ; __DBDMA__ 
  457.  
  458.